package com.chaopei.goods_mng_impl.impl;

import com.chaopei.goods_mng_api.api.ProductFacade;
import com.chaopei.goods_mng_api.entity.Product;
import com.chaopei.goods_mng_impl.mapper.ProductMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Corday 天涯
 * @Date 2022/5/5 15:25
 */
@Service
public class ProductFacadeImpl implements ProductFacade {
    @Resource
    private ProductMapper productMapper;
    @Override
    public List<Product> queryProducts() {
        return productMapper.selectProducts();
    }

    @Override
    public List<Product> queryProductsByNameOrCode(String nameCode) {
        return productMapper.selectProductsByNameOrCode(nameCode);
    }

    @Override
    public Product queryProductByCode(String code) {
        return productMapper.selectProductByCode(code);
    }
}
